package model;

import java.util.Collection;

import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "PECA")
@DiscriminatorValue("PECA")
public class Peca extends ItemEstoque {

	private static final long serialVersionUID = -7559757891895021961L;

	@ManyToMany(mappedBy = "colPeca")
	private Collection<Visita> colVisita;

	@ManyToMany(mappedBy = "colPeca")
	private Collection<Viatura> colViatura;

	@ManyToOne(optional=true)
	private Base base;
	
	public Collection<Visita> getColVisita() {
		return colVisita;
	}

	public void setColVisita(Collection<Visita> colVisita) {
		this.colVisita = colVisita;
	}

	public Collection<Viatura> getColViatura() {
		return colViatura;
	}

	public void setColViatura(Collection<Viatura> colViatura) {
		this.colViatura = colViatura;
	}

	public Base getBase() {
		return base;
	}

	public void setBase(Base base) {
		this.base = base;
	}

}
